package com.chenjt.juc.three_completableFuture;

import java.util.concurrent.CompletableFuture;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2024/7/6 10:26
 */
public class CompletableFutureGetJoinDemo {

    public static void main(String[] args) {

        CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(() -> {
            return "hello 1234";
        });

//        System.out.println(completableFuture.get());
        System.out.println(completableFuture.join());

    }

}


class Student{

    private Integer id;
    private String studentName;
    private String major;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", studentName='" + studentName + '\'' +
                ", major='" + major + '\'' +
                '}';
    }
}
